
var express = require('express');
const ProductController = require('../../controllers/admin/ProductController');
var ProductRouter = express.Router();
// 图片上传
const multer = require('multer')
const upload = multer({ dest: 'public/productsupload/' })

ProductRouter.post('/adminApi/product/add', upload.single('file'), ProductController.add);//添加
ProductRouter.get('/adminApi/product/list', ProductController.getList);//获取列表
ProductRouter.post('/adminApi/product/list', upload.single('file'),ProductController.updateOne);//更新列表
ProductRouter.delete('/adminApi/product/list/:id', ProductController.delOne);//删除一个列表的数据
ProductRouter.get('/adminApi/product/list/:id', ProductController.getList);//根据id

module.exports = ProductRouter;
